﻿using System;
using System.Text;
using Microsoft.Practices.RecipeFramework;
using Microsoft.Practices.RecipeFramework.Library;
using EnvDTE;

namespace WiGO.RCX.PF.ValueProviders
{
    public class SelectedFolderValueProvider : ValueProvider
    {
        public override bool OnBeginRecipe(object currentValue, out object newValue)
        {
            if (currentValue != null)
            {
                // Do not assign a new value, and return false to flag that 
                // we don't want the current value to be changed.
                newValue = null;
                return false;
            }
            DTE vs = (DTE)GetService<DTE>(true);
            Project current = DteHelper.GetTarget(vs) as Project;
            newValue = current;
            return true;
        }
    }
}
